use std::collections::HashSet;

pub fn new_count_distinct(input_str: &str) -> usize {
    let input_bytes = input_str.as_bytes();
    let mut bytes_set: HashSet<&[u8]> = HashSet::new();
    let mut start = 0;
    let mut end = 0;
    while end < input_bytes.len() {
        if input_bytes[end] == b',' {
            bytes_set.insert(&input_bytes[start..end]);
            end += 1;
            start = end;
        } else {
            end += 1;
        }
    }

    bytes_set.insert(&input_bytes[start..end]);
    bytes_set.len()
}
